<?php
/**
 * Created by .
 * User: 小涛.
 * Date: 2018/12/29
 * Time: 10:10
 */

namespace app\admin\model;

use think\Model;
use think\Request;
use think\Session;

/**
 * Class Member 会员信息
 * @package app\admin\model
 */
class Member extends Model
{
    //列表
    public static function listMember($listRow = 10){
        return self::order("id desc")
            -> where(["status" => intval(Session::get('user_activity'))])
            -> paginate($listRow, false, [
                "query" => Request::instance() -> param()
            ]);
    }

    //查询open_id是否存在
    public static function MemberByOpenId($open_id){
        return self::where(["open_id" => $open_id])
            -> where(["status" => intval(Session::get('user_activity'))])
            -> find();
    }

}